<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;

class Part extends Model
{
	use HasDateTimeFormatter; 
	public function device(): BelongsTo
    {
        return $this->belongsTo(Device::class, 'Owning_device', 'id');
    }
     public function partCategory()
    {
        return $this->belongsTo(PartCategory::class, 'Parts_classification', 'id');
    }
    // public function manufacturer()
    // {
    //     return $this->belongsTo(Manufacturer::class, 'manufacturer', 'id');
    // }

      //关联厂商表

    public function manufacturer()
{
    return $this->belongsTo(Manufacturer::class, 'manufacturer_id', 'id');
}
    


  }
 